package cn.middle.basic.mapper;

import cn.middle.basic.entity.SysUser;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.middle.common.base.mapper.BaseMapper;

public interface SysUserMapper extends BaseMapper<SysUser> {
	
	public SysUser loginByUserName(@Param("accountName")String accountName);
	
	public List<SysUser> listConditions(@Param("realName")String realName,@Param("accountName")String accountName,@Param("phone")String phone,@Param("status")Byte status);
	
	//解除角色绑定关系
	public int disarmRole(@Param("userId") Long userId);
	
	/**
	 * 获取角色下的用户信息
	 * @param roleId
	 * @return
	 */
	public List<SysUser> usersByRoleId(@Param("roleId") Long roleId);
	
	/**
	 * 关联用户与角色
	 * @param userId
	 * @param roleId
	 * @return
	 */
	public int associationUserRole(@Param("userId")Long userId,@Param("roleId") Long roleId);
}